<!-- 我的收藏 -->
<template>
	<z-paging ref="paging" v-model="dataList" @query="queryList" v-if="isshow">
		<view class="list">
		<courseCard v-for="(item,index) in dataList" :key="index" :item="item" @goDetail="goDetail(item)"/>
		</view>
	</z-paging>
</template>

<script>
	import {
		collection
	} from '@/apis/apis.js'
	import courseCard from '../modules/courseCard.vue'
	export default {
		components: {
			courseCard
		},
		data() {
			return {
				dataList: [],
				isshow:false
			}
		},
		onShow() {
			this.isshow = true
		},
		onHide() {
			this.isshow = false
		},
		methods: {
			queryList(pageNo, pageSize) {
				collection({
					pageNum: pageNo,
					pageSize: pageSize
				}).then(res => {
					console.log(res);
					this.dataList = res.data
					this.$refs.paging.complete(res.data);
				})
			},
			goDetail(e) {
				console.log(e);
				let id=e.id
				uni.navigateTo({
					url: `/pages/index/courseItem/courseItem?id=${id}`
				})
			}
		}
	}
</script>

<style lang="scss">
	page{
		
background: #F8F8F8;
	}
	.list{
		padding: 30rpx 30rpx 0;
	}
</style>
